import { uploadURL } from '../axios'

export function getDomain(url) {
  const domain = uploadURL
  if (!url) return
  if (url.indexOf(domain) !== -1 || url.indexOf('http') !== -1) {
    // 当前url包含域名
    return url
  } else {
    return domain + url
  }
}

export const addStyles = (defaultStyle, style) => {
  let list = [defaultStyle]
  if (Array.isArray(style)) return [...list, ...style]
  list.push(style)
  return list
}